import java.util.ArrayList;
import java.util.Scanner;


public class ScannerDriver {

	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		System.out.println("Enter the name of the fileMini containing a grammar: ");
		//System.out.println("Enter the filename of the grammar to use: ");
		String grammarFn = scan.nextLine();
		
		System.out.println("Enter the name of the file to scan: ");
		String toscanFn = scan.nextLine();
		
		Lexer lex = Lexer.getLexer(grammarFn);//try to load it, and make it otherwise
		
		if (args != null && args.length != 0){//if you specify an argument, we don't save it
			lex.dfa.save(grammarFn);
		}
		ArrayList<ArrayList<String>> tokens = lex.scanFile(toscanFn);
		System.out.println("I found the following tokens:\n" + tokens);
		
	}

}
